<template>
  <div class="Son">
    <h1>名字：{{ name }},价格：{{ price }}</h1>
  </div>
</template>
  
  <script>
import { inject,toRefs } from 'vue';
export default {
  name: "mySon",
  setup(){
    let car = inject('car');
    return {
        ...toRefs(car)
    }
  }
};
</script>
  
  <style lang="css" scoped>
.Son {
  background-color: orange;
  padding: 10px;
}
</style>